<!--! Snippet for a <th> corresponding to a sortable column.

    Expects the following variables to be set specifically:

    class_    the CSS class for the column
    title     the title attribute for the column

    e.g.  <py:with vars="class_ = 'name'; title = 'Name'">
            <xi:include href="sortable_th.html" />
          </py:with>

    Expects the following variables from the context: order, desc, href, reponame, path, stickyrev
-->
<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:py="http://genshi.edgewall.org/"
    xmlns:xi="http://www.w3.org/2001/XInclude" py:strip="">
  <th class="$class_${order == class_ and (desc and ' desc' or ' asc') or ''}">
    <a title="${_('Sort by %(col)s %(direction)s', col=class_, 
                  direction=(order == class_ and not desc 
                             and _('(descending)') or _('(ascending)')))}"
      href="${href.browser(reponame, path, rev=stickyrev, order=(class_ != 'name' and class_ or None),
      desc=(class_ == order and not desc and 1 or None))}">$title</a>
  </th>
</html>
